package com.lineage.data.item_armor;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class Hades_Cloak extends ItemExecutor {
  private static final Log _log = LogFactory.getLog(Hades_Cloak.class);
  
  private int _r;
  
  private int _dmg_min;
  
  private int _dmg_max;
  
  public static ItemExecutor get() {
    return new Hades_Cloak();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    try {
      if (item == null)
        return; 
      if (pc == null)
        return; 
      switch (data[0]) {
        case 0:
          pc.set_hades_cloak(0, 0, 0);
          break;
        case 1:
          pc.set_hades_cloak(this._r, this._dmg_min, this._dmg_max);
          break;
      } 
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
  }
  
  public void set_set(String[] set) {
    try {
      this._r = Integer.parseInt(set[1]);
    } catch (Exception exception) {}
    try {
      this._dmg_min = Integer.parseInt(set[2]);
    } catch (Exception exception) {}
    try {
      this._dmg_max = Integer.parseInt(set[3]);
    } catch (Exception exception) {}
  }
}
